package com.ywjh.inter;


import java.io.*;
import java.net.*;

public class Test {
    public static void main(String[] args) throws IOException {
        Socket socket = null;
        try {
            /*socket = new Socket("localhost", 8090); // 连接到本地的12345端口
            BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
            out.println("发送信息到服务器"); // 发送信息到服务器
            System.out.println("从服务器接收到信息: " + in.readLine()); // 接收服务器响应
            in.close();
            out.close();
            socket.close();
*/



            //String sss = "  7.2mmol/L (GLUC 2024/07/20 12:13 SN:PMA240623000003 )";
            //String sss = "1234 umol/L ( UA  2021/12/31 23:59 SN:PMA123456789012 )";
            String sss = "  369umol/L ( UA  2024/07/28 09:00 SN:PMA240623000003 )";
            System.out.println(sss.length());
            System.out.println(sss.substring(13,17));
            System.out.println(sss.substring(0,5).trim());
            System.out.println(sss.substring(5,12));
            System.out.println(sss.substring(18,34));

            System.out.println("aaa"+sss.substring(20,22));
            System.out.println(sss.substring(23,25));
            System.out.println(sss.substring(26,28));
            System.out.println(sss.substring(29,31));
            System.out.println(sss.substring(32,34));
            System.out.println(sss.substring(38,54));

            String ss = "High (GLUC 2021/12/31 23:59 SN:PMA1234567890123)";

            System.out.println(ss);
            System.out.println(ss.length());
            System.out.println(ss.substring(6,11));
            System.out.println(ss.substring(0,5));
            System.out.println("年:"+ss.substring(13,15));
            System.out.println(ss.substring(16,18));
            System.out.println(ss.substring(19,21));
            System.out.println(ss.substring(22,24));
            System.out.println(ss.substring(25,27));
            System.out.println(ss.substring(28,30));
            System.out.println(ss.substring(31,47));

            System.out.println(ss.toUpperCase().contains("HIGH"));
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (socket != null) socket.close();
        }
    }
}
